<?php
  session_start();  
  $error = false;
  if (isset($_SESSION['error'])&&!empty($_SESSION['error']))
  {
    $error = $_SESSION['error'];
  }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PetCare</title>

<link href="login-box.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">		
            $.ajax({
              url: "getcontents.php",
              type: "POST",
              data: {action: 'dates.dat'},
              cache: false,
              success: function(data){      
                data = data.split('\r\n');
                for (var i=0;i<data.length-1;i++)
                {
                  $("#preparationModes").append($('<option></option>').attr("value", data[i]).text(data[i]));
                  $("#trainingModes").append($('<option></option>').attr("value", data[i]).text(data[i]));
                  $("#workingModes").append($('<option></option>').attr("value", data[i]).text(data[i]));
                }                
                $('#workingModes option:last-child').attr('selected', 'selected');
              }});		    
</script>
</head>

<body>


<div style="padding: 100px 0 0 250px;">


<div id="login-box">

<H2>PetCare</H2>
<form action="PreparationMode.php" method="post">
<p><?php if ($error) { echo $error; unset($_SESSION['error']); } else { echo "Please select your mode:"; } ?></p>
<table border="0">
<tr>
  <select id="preparationModes" name="filename"></select>
</tr>
<tr>
  <input type="submit" value="Preparation Mode" style="width:150px;"></input>
</tr>
</form>
<form action="TrainingMode.php" method="post">
<table border="0">
<tr>
  <select id="trainingModes" name="filename"></select>
</tr>
<tr>
  <input type="submit" value="Training Mode" style="width:150px;"></input>
</tr>
</form>
<form action="WorkingMode.php" method="post">
<tr>
  <select id="workingModes" name="filename"></select>
</tr>
<tr>
  <input type="submit" value="Working Mode" style="width:150px;"></input>
</tr>
</table>
</form>






</div>

</div>













</body>
</html>
